<?
require_once("inc/func.inc.php");
$user_arr = check_user();
$array = array();
$grp = $user_arr['grp'];
$pi_arr=pathinfo(__FILE__);
$fname = $pi_arr['filename'];
chkprv($fname,$grp);
$prv = array();
$prv = get_control_prv($grp);

$sql = "select p.id,pname,type,jingzhi,count(p.id) as fene ,sum(jine) as jine from product_type as p , c_p as c,customer as cu where p.id=c.pid  and c.cid=cu.id group by c.pid";
$sth = query($sql);
$arr = array();
$pt_arr = array();
while($arr =  mysql_fetch_assoc($sth))
{
	$pt_arr[] = $arr;
}
$tpl->assign('pt_arr',$pt_arr);
$tpl->assign('prv',$prv);
$tpl->display("_chanpin.html");
?>